import 'package:mobile_app.core/core/domain/entities/primary_color.dart';
import 'package:mobile_app.core/core/domain/helpers/get_dark_theme_default_primary_color/helper.dart';

abstract class GetDarkThemeEffectivePrimaryColor {
  DarkThemePrimaryColor call({
    required DarkThemePrimaryColor selectedPrimaryColor,
    required bool primaryColorChangePermitted,
  });
}

class GetDarkThemeEffectivePrimaryColorImpl implements GetDarkThemeEffectivePrimaryColor {
  const GetDarkThemeEffectivePrimaryColorImpl({
    required GetDarkThemeDefaultPrimaryColor getDarkThemeDefaultPrimaryColor,
  }) : _getDarkThemeDefaultPrimaryColor = getDarkThemeDefaultPrimaryColor;

  final GetDarkThemeDefaultPrimaryColor _getDarkThemeDefaultPrimaryColor;

  @override
  DarkThemePrimaryColor call({
    required DarkThemePrimaryColor selectedPrimaryColor,
    required bool primaryColorChangePermitted,
  }) {
    if (primaryColorChangePermitted) {
      return selectedPrimaryColor;
    }

    final defaultPrimaryColor = _getDarkThemeDefaultPrimaryColor();

    return defaultPrimaryColor;
  }
}
